﻿using DLUProject.Domain;
using DLUProject.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ColorLife.Core.Helper;
public partial class KTX_PhiDienNuoc : BaseUserControl
{
    public ModuleInstanceExtension moduleInstance { get; set; }
    public IServices<KhuNha> _serviceKhuNha { get; set; }
    public IServices<Phong> _servicePhong { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        Page.Title = "Xem phí Điện nước";
        if (Session["SinhVien"] == null)
            Response.Redirect("Default.aspx?tab=dangnhap");
        if (!IsPostBack)
        {
            foreach (var item in _serviceKhuNha.Table)
            {
                ddlKhuNha.Items.Add(new ListItem(item.TenKhuNha, item.IDKhuNha.ToString()));
            }
           
        }
    }
    protected void ddlKhuNha_SelectedIndexChanged(object sender, EventArgs e)
    {
        
        var phongs = _servicePhong.Table.Where(c => c.IDKhuNha == ddlKhuNha.SelectedValue.ToInt());
        ddlPhong.Items.Clear();
        foreach (var item in phongs)
        {
            ddlPhong.Items.Add(new ListItem(item.TenPhong, item.IDPhong.ToString()));
        }
    }
    protected void btnXemMSSV_Click(object sender, EventArgs e)
    {
        Panel1.Visible = true;
    }
    protected void btnXemPhong_Click(object sender, EventArgs e)
    {

    }
}